package com.guan.ordering_sys.generator.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.guan.ordering_sys.common.ResultApi;
import com.guan.ordering_sys.generator.entity.EmployeePost;
import com.guan.ordering_sys.generator.service.EmployeePostService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  EmployeePostController 前端控制器
 * </p>
 *
 * @author 关远键
 * @version v1.0.3
 * @since 2021-06-18
 */
@Api(tags = "权限控制器")
@RestController
@RequestMapping("/api/employee-post")
public class EmployeePostController {

    @Autowired
    private EmployeePostService epService;

    @ApiOperation("添加权限")
    @PostMapping("/add")
    public ResultApi addEmployee(EmployeePost ep) {
        return ResultApi.success(epService.insert(ep));
    }

    @ApiOperation("获取用户列表")
    @GetMapping("/getListByPostId/{id}")
    public ResultApi addEmployee(@PathVariable("id") Integer id) {
        return ResultApi.success(epService.getListByPostId(id));
    }

}

